import uuid

from django.db import models
from django.utils import timezone

class Department(models.Model):
    objects = models.Manager()

    id = models.CharField(primary_key=True, default=uuid.uuid4, editable=False, max_length=255)
    name = models.CharField(max_length=255, unique=True, help_text="部门名称")
    description = models.TextField(null=True, blank=True, help_text="部门描述")
    create_time = models.DateTimeField(default=timezone.now, help_text='创建时间')
    update_time = models.DateTimeField(auto_now=True, help_text='更新时间')

    def __str__(self):
        return self.name

    class Meta:
        db_table = 'depart'
        verbose_name = "部门"
        verbose_name_plural = "部门"
        app_label = 'DepartManagement'
